package cn.lh.feignClient;

import cn.lh.domain.Store;
import cn.lh.util.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class StoreFeignClickFallbackFactory implements FallbackFactory<StoreFeignClient> {
    @Override
    public StoreFeignClient create(Throwable throwable) {
        return new StoreFeignClient() {
            @Override
            public JsonResult add(Store store) {
                System.out.println("StoreServer熔断成功");
                return JsonResult.set(false, "StoreServer熔断成功");
            }
        };
    }
}
